package caras;
import java.io.BufferedReader;
import java.io.InputStreamReader;

import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

		import java.awt.*;
		import javax.script.*;
		import javax.swing.*;

		public class GetCurrentTrackArtwork {
			public static void main(String[] args) throws Throwable {
				JFrame frame = new JFrame(); // loads AWT first
				
				String a1="hello sami" +
						"";
				String a2="alex";
				
				String script="tell current application\n say \""+a1+"\""+" using \""+a2+"\""+"\n"+"end tell"; 
//				
//				String script = 
//					"tell current application\n"+
//					" say"+\""+a1+"\"";
				
				System.out.println(script);
				
				ScriptEngineManager mgr = new ScriptEngineManager();
				ScriptEngine engine = mgr.getEngineByName("AppleScript");
				ScriptContext context = engine.getContext();
				engine.eval(script, context);
		
			}
		}
	
	